﻿//-------------------------------------------------------------------
//	Copyright (c) 2012 Fedotov I.V.
//	All rights reserved.
//-------------------------------------------------------------------
/*
	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU Lesser General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
	GNU Lesser General Public License for more details.

	You should have received a copy of the GNU Lesser General Public License
	along with this program. If not, see http://www.gnu.org/licenses/.

	Project SVN page 
*/

#ifndef __TRANSFORMATION_H__
#define __TRANSFORMATION_H__

#include <stdio.h>
#include <string.h>
#include <vector>

#include "../datacontainerbase.h"
#include "../filecontainer.h"
#include "../../sptr.h"

class Transformation : public DataContainerBase{

private:
  void init();
public:

	unsigned long flags;
  //Сдвиг картинки относительно 0
  float pshx;//p - процент от длины картинки
  float pshy;
  //Точка для поворота и масштабирования (resize)
  float prx;
  float pry;
  //Обрезка (делается до поворота и увеличения)
  float clip_pshx;
  float clip_pshy;
  float clip_plx;
  float clip_ply;
  //Scale (1.0;-1.0 - no scale resultX=mlx*scaleX)
  float scaleX;
  float scaleY;
  //Rotate in degrees (at 3600000=360.0000 degrees to -3600000)
  long rotateAngle;
     

  Transformation();
	Transformation(__int64 _ID);
	~Transformation();

	long parse();
	long parse(SPtr<FileContainer> _inFileContainer,long _offsetInData);
	int join();

	int checkAndSetObjectsAtIDs();

};


#endif